package com.platform.module.dao.enums.task;

/**
 * @author Long
 **/
public enum UserBonusTaskTypeEnum {

    // 兑换码奖励
    REDEMPTION_CODE("r_code", "Redeem Rewards", "兑换码奖励"),


    ;

    private final String code;
    private final String msg;
    private final String title;

    UserBonusTaskTypeEnum(String code, String msg, String title) {
        this.msg = msg;
        this.code = code;
        this.title = title;
    }

    public static UserBonusTaskTypeEnum getByCode(String taskType) {
        for (UserBonusTaskTypeEnum value : values()) {
            if (value.getCode().equals(taskType)) {
                return value;
            }
        }
        return null;
    }

    public String getMsg() {
        return msg;
    }

    public String getCode() {
        return code;
    }


    public static String getMsgByCode(String code) {
        for (UserBonusTaskTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value.getMsg();
            }
        }
        return "";
    }

    public String getTitle() {
        return title;
    }
}
